package org.example.contestb.entity;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.example.contestb.util.DateConverter;

import java.io.Serial;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ExcelIgnoreUnannotated
@TableName("tb_patient")
public class Patient {
    @Serial
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)
    private Long id;

    @TableField(value = "name")
    @ExcelProperty("患者姓名")
    private String name;

    @TableField(value = "age")
    @ExcelProperty("患者年龄")
    private Integer age;

    @TableField(value = "admission_date")
    @ExcelProperty(value = "入院日期",converter = DateConverter.class)
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date admissionDate;

    @TableField(value = "PMR")
    @ExcelProperty("既往病史")
    private String PMR;

    @TableField(value = "diagnosis_result")
    @ExcelProperty("诊断结果")
    private String diagnosisResult;

    @TableField(value = "treatment")
    @ExcelProperty("治疗方案")
    private String treatment;

    @TableField(value = "gender")
    @ExcelProperty("性别")
    private String gender;

}
